package JavaEE初阶.Multi;

import javax.print.attribute.standard.RequestingUserName;
import javax.xml.transform.Result;

public class Demo4 {
    public static int sum = 0;

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable(){
            @Override
            public void run(){
                int result = 0;
                for(int i = 0;  i< 100;i++){
                    result += i;
                }
                sum = result;
            }
        });
        t1.start();
        t1.join();
        System.out.println(sum);
    }
}
